<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />
        <?php
        echo Yii::app()->bootstrap->registerAllCss();
        echo Yii::app()->bootstrap->registerCoreScripts();
        ?>
	
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>
        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <button type="button" class="btn btn-navbar" data-toogle="collage" data-target=".nav-collapse">    
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    
                    <a class="brand" href="<?php echo Yii::app()->homeUrl;?>">
                        <?php echo  CHtml::encode (Yii::app()->name);?>
                    </a>
                    <div class="nav-collapse collapse">
                        <?php 
                         $admin = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'root') ? true : false;
                         $admin1 = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'rh') ? true : false;  
                         $admin2 = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'acatlan') ? true : false;
                         $acatzingo = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'acatzingo') ? true : false;
                          $ajalpan = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'ajalpan') ? true : false;
                          $amalucan = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'amalucan') ? true : false;
                          $amozoc = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'amozoc') ? true : false;
                          $animas = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'animas') ? true : false;
                          $apizaco = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'apizaco') ? true : false;
                          $apizaco2 = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'apizaco2') ? true : false;
                          $atlixco = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'atlixco') ? true : false;
                          $atlixco2 = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'atlixco2') ? true : false;
                          $autosnp = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'autossanpedro') ? true : false;
                          $balcones = (isset(Yii::app()->user->name) and Yii::app()->user->name == 'balcones') ? true : false;
                             


                        $this->widget('bootstrap.widgets.TbMenu', array(
    'type'=>'tabs', // '', 'tabs', 'pills' (or 'list')
    'stacked'=>false, // whether this is a stacked menu
    'items'=>array(
				
               array('label'=>'Contacto', 'url'=>array('/site/contact')),
                array('label'=>'Login', 'icon'=>'user', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
                array('label'=>'Logout ('.Yii::app()->user->name.')','icon'=>'user', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
               // array('label'=>'Usuarios', 'url'=>array('usuario/admin')),
                array('label'=>'Usuarios', 'url'=>array('/usuario/admin'), 'visible' => $admin),
        
                array('label'=>'Sucursales', 'url'=>array('/site/contact'), 'visible' => $admin),
        
                array('label'=>'Nuevo Ticket Acatlan', 'url'=>array('ticketsacatlan/create'), 'visible' => $admin2),
                array('label'=>'Tickets Acatlan', 'url'=>array('ticketsacatlan/admin'),'visible' => $admin),
       
                array('label'=>'Lista Tickets', 'url'=>array('ticketsacatlan/index'), 'visible' => $admin2),
                array('label'=>'Nuevo Ticket RH', 'url'=>array('tickets/create'), 'visible' => $admin1),
                array('label'=>'Tickets R.H.', 'url'=>array('tickets/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('tickets/index'), 'visible' => $admin1),
                
                array('label'=>'Nuevo Ticket Acatzingo', 'url'=>array('ticketsAcatzingo/create'), 'visible' => $acatzingo),
                array('label'=>'Tickets Acatzingo', 'url'=>array('ticketsAcatzingo/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('ticketsAcatzingo/index'), 'visible' => $acatzingo),
        
        
                array('label'=>'Nuevo Ticket Ajalpan', 'url'=>array('ticketsAjalpan/create'), 'visible' => $ajalpan),
                array('label'=>'Tickets Ajalpan', 'url'=>array('ticketsAjalpan/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('ticketsAjalpan/index'), 'visible' => $ajalpan),
        
                array('label'=>'Nuevo Ticket Amalucan', 'url'=>array('ticketsAmalucan/create'), 'visible' => $amalucan),
                array('label'=>'Tickets Amalucan', 'url'=>array('/ticketsAmalucan/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('ticketsAmalucan/index'), 'visible' => $amalucan),
        
                array('label'=>'Nuevo Ticket Amozoc', 'url'=>array('ticketsAmozoc/create'), 'visible' => $amozoc),
                array('label'=>'Tickets Amozoc', 'url'=>array('ticketsAmozoc/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('ticketsAmozoc/index'), 'visible' => $amozoc),
        
                array('label'=>'Nuevo Ticket Animas', 'url'=>array('ticketsAnimas/create'), 'visible' => $animas),
                array('label'=>'Tickets Animas', 'url'=>array('ticketsAnimas/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('ticketsAnimas/index'), 'visible' => $animas),
        
                array('label'=>'Nuevo Ticket Apizaco', 'url'=>array('ticketsApizaco/create'), 'visible' => $apizaco),
                array('label'=>'Tickets Apizaco', 'url'=>array('ticketsApizaco/admin'),'visible' => $admin),
                array('label'=>'Editar Apizaco', 'url'=>array('ticketsApizaco/index'), 'visible' => $apizaco),
        
                 array('label'=>'Nuevo Ticket Apizaco', 'url'=>array('ticketsApizaco2/create'), 'visible' => $apizaco2),
                array('label'=>'Tickets Apizaco 2', 'url'=>array('ticketsApizaco2/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('ticketsApizaco2/index'), 'visible' => $apizaco2),
        
                  array('label'=>'Nuevo Ticket Atlixco', 'url'=>array('ticketsAtlixco1/create'), 'visible' => $atlixco),
                array('label'=>'Tickets Atlixco', 'url'=>array('ticketsAtlixco1/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('ticketsAtlixco1/index'), 'visible' => $atlixco),
        
                array('label'=>'Nuevo Ticket Atlixco', 'url'=>array('ticketsAtlixco2/create'), 'visible' => $atlixco2),
                array('label'=>'Tickets Atlixco 2', 'url'=>array('ticketsAtlixco2/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('ticketsAtlixco2/index'), 'visible' => $atlixco2),
          
                array('label'=>'Nuevo Ticket Autos San Pedro ', 'url'=>array('ticketsAutosSanPedro/create'), 'visible' => $autosnp),
                array('label'=>'Tickets Autos San Pedro ', 'url'=>array('ticketsAutosSanPedro/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('ticketsAutosSanPedro/index'), 'visible' => $autosnp ),
                
                array('label'=>'Nuevo Ticket Balcones', 'url'=>array('ticketsBalcones/create'), 'visible' => $balcones),
                array('label'=>'Tickets Balcones', 'url'=>array('ticketsBalcones/admin'),'visible' => $admin),
                array('label'=>'Editar Tickets', 'url'=>array('ticketsBalcones/index'), 'visible' => $balcones ),
                
        
        
        ),        
                       'htmlOptions'=> array('class'=>'nav  navbar-nav' ),     
		)); ?>
                        
                  <div style="text-align: right;">
<?php if(!Yii::app()->user->isGuest and isset(Yii::app()->user->last_login)){
echo "Ultimo Acceso: ".Yii::app()->dateFormatter->format("d-M-y h:m a", Yii::app()->user->last_login);} ?>
</div>      
  
                        
            </div>
            </div>
            </div>
	</div><!-- mainmenu -->
        
        <div class="container">
            <div class="page-header">
                <br /> <br />
	<?php if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
		)); ?><!-- breadcrumbs -->
	<?php endif?>
            </div>
            
	<?php echo $content; ?>

	

	<div class="footer text-center">
		
                Prendamex Grupo Puebla &copy; <?php echo date('Y'); ?>. <br/>
                Todos los Derechos Reservados<br/>
		
	</div><!-- footer -->
        </div>


</body>
</html>
